package com.apes.fn.server.workDesk.smartHelper.process.person;

import com.alibaba.fastjson.JSONArray;
import com.apes.fn.server.workDesk.smartHelper.process.CommonSmartDataProcess;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @program: apes-server
 * @description:
 * @author: czs
 * @create: 2023-06-15 10:21
 **/
@Service
public class RemoveProcess extends CommonSmartDataProcess {

    private static final List<String> LEVEL_LIST = Arrays.asList("smartHelper","Person","PersonGroup","Remove");

    @Override
    public List<String> getLevelList() {
        return LEVEL_LIST;
    }

    @Override
    public boolean support(String type) {
        return true;
    }

    @Override
    public String getName() {
        return "调动";
    }

    @Override
    public Map findResultData(JSONObject resultMap) {
        JSONArray array = smartHelperDao.queryPersonRemove(resultMap);
        return mapper(
                "id",getLevelList().get(getLevelList().size()-1),
                "name",getName(),
                "data",array
        );
    }
}
